import '../../assets/css/index.sass'
import { Layout } from 'antd';
import React, { useEffect } from 'react';
import TopNav from './TopNav'
import Main from './Main'
import { useDispatch } from 'react-redux'
import { Outlet } from 'react-router-dom'
import { setMenuData } from '../../store/home/homeSlice'



const { Header } = Layout;

export default function Index() {
    const dispatch = useDispatch()

    useEffect(() => {
        dispatch(setMenuData())
        // console.log("home");
    }, [])

    return (
        <div className='home'>
            <Layout>
                <Header className="homeHeader">
                    <TopNav />
                </Header>
                <Layout>
                    <Outlet />
                    {/* <Main /> */}
                </Layout>
            </Layout>
        </div>
    )
}
